Optimal. Leaf size=65 \[ -\frac{(c+d x) \left (B \log \left (\frac{e (a+b x)^2}{(c+d x)^2}\right )+A\right )}{g^2 (a+b x) (b c-a d)}-\frac{2 B}{b g^2 (a+b x)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0774241, antiderivative size = 105, normalized size of antiderivative = 1.62, number of steps used = 4, number of rules used = 3, integrand size = 32, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.094, Rules used = {2525, 12, 44} \[ -\frac{B \log \left (\frac{e (a+b x)^2}{(c+d x)^2}\right )+A}{b g^2 (a+b x)}-\frac{2 B d \log (a+b x)}{b g^2 (b c-a d)}+\frac{2 B d \log (c+d x)}{b g^2 (b c-a d)}-\frac{2 B}{b g^2 (a+b x)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2525
Rule 12
Rule 44
Rubi steps
\begin{align*} \int \frac{A+B \log \left (\frac{e (a+b x)^2}{(c+d x)^2}\right )}{(a g+b g x)^2} \, dx &=-\frac{A+B \log \left (\frac{e (a+b x)^2}{(c+d x)^2}\right )}{b g^2 (a+b x)}+\frac{B \int \frac{2 (b c-a d)}{g (a+b x)^2 (c+d x)} \, dx}{b g}\\ &=-\frac{A+B \log \left (\frac{e (a+b x)^2}{(c+d x)^2}\right )}{b g^2 (a+b x)}+\frac{(2 B (b c-a d)) \int \frac{1}{(a+b x)^2 (c+d x)} \, dx}{b g^2}\\ &=-\frac{A+B \log \left (\frac{e (a+b x)^2}{(c+d x)^2}\right )}{b g^2 (a+b x)}+\frac{(2 B (b c-a d)) \int \left (\frac{b}{(b c-a d) (a+b x)^2}-\frac{b d}{(b c-a d)^2 (a+b x)}+\frac{d^2}{(b c-a d)^2 (c+d x)}\right ) \, dx}{b g^2}\\ &=-\frac{2 B}{b g^2 (a+b x)}-\frac{2 B d \log (a+b x)}{b (b c-a d) g^2}-\frac{A+B \log \left (\frac{e (a+b x)^2}{(c+d x)^2}\right )}{b g^2 (a+b x)}+\frac{2 B d \log (c+d x)}{b (b c-a d) g^2}\\ \end{align*}
Mathematica [A] time = 0.058319, size = 111, normalized size = 1.71 \[ \frac{2 B (b c-a d) \left (-\frac{1}{(a+b x) (b c-a d)}-\frac{d \log (a+b x)}{(b c-a d)^2}+\frac{d \log (c+d x)}{(b c-a d)^2}\right )}{b g^2}-\frac{B \log \left (\frac{e (a+b x)^2}{(c+d x)^2}\right )+A}{b g^2 (a+b x)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.079, size = 157, normalized size = 2.4 \begin{align*}{\frac{dA}{{g}^{2} \left ( ad-bc \right ) } \left ({\frac{ad}{dx+c}}-{\frac{bc}{dx+c}}+b \right ) ^{-1}}-2\,{\frac{dB}{{g}^{2}b \left ( dx+c \right ) } \left ({\frac{ad}{dx+c}}-{\frac{bc}{dx+c}}+b \right ) ^{-1}}+{\frac{dB}{{g}^{2} \left ( ad-bc \right ) }\ln \left ({\frac{e}{{d}^{2}} \left ({\frac{ad}{dx+c}}-{\frac{bc}{dx+c}}+b \right ) ^{2}} \right ) \left ({\frac{ad}{dx+c}}-{\frac{bc}{dx+c}}+b \right ) ^{-1}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.23987, size = 252, normalized size = 3.88 \begin{align*} -B{\left (\frac{\log \left (\frac{b^{2} e x^{2}}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac{2 \, a b e x}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac{a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right )}{b^{2} g^{2} x + a b g^{2}} + \frac{2}{b^{2} g^{2} x + a b g^{2}} + \frac{2 \, d \log \left (b x + a\right )}{{\left (b^{2} c - a b d\right )} g^{2}} - \frac{2 \, d \log \left (d x + c\right )}{{\left (b^{2} c - a b d\right )} g^{2}}\right )} - \frac{A}{b^{2} g^{2} x + a b g^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.01482, size = 228, normalized size = 3.51 \begin{align*} -\frac{{\left (A + 2 \, B\right )} b c -{\left (A + 2 \, B\right )} a d +{\left (B b d x + B b c\right )} \log \left (\frac{b^{2} e x^{2} + 2 \, a b e x + a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right )}{{\left (b^{3} c - a b^{2} d\right )} g^{2} x +{\left (a b^{2} c - a^{2} b d\right )} g^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] time = 1.91317, size = 253, normalized size = 3.89 \begin{align*} - \frac{B \log{\left (\frac{e \left (a + b x\right )^{2}}{\left (c + d x\right )^{2}} \right )}}{a b g^{2} + b^{2} g^{2} x} - \frac{2 B d \log{\left (x + \frac{- \frac{2 B a^{2} d^{3}}{a d - b c} + \frac{4 B a b c d^{2}}{a d - b c} + 2 B a d^{2} - \frac{2 B b^{2} c^{2} d}{a d - b c} + 2 B b c d}{4 B b d^{2}} \right )}}{b g^{2} \left (a d - b c\right )} + \frac{2 B d \log{\left (x + \frac{\frac{2 B a^{2} d^{3}}{a d - b c} - \frac{4 B a b c d^{2}}{a d - b c} + 2 B a d^{2} + \frac{2 B b^{2} c^{2} d}{a d - b c} + 2 B b c d}{4 B b d^{2}} \right )}}{b g^{2} \left (a d - b c\right )} - \frac{A + 2 B}{a b g^{2} + b^{2} g^{2} x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.39159, size = 254, normalized size = 3.91 \begin{align*}{\left (2 \,{\left (b^{2} c g^{2} - a b d g^{2}\right )}{\left (\frac{d \log \left ({\left | \frac{b c g}{b g x + a g} - \frac{a d g}{b g x + a g} + d \right |}\right )}{b^{4} c^{2} g^{4} - 2 \, a b^{3} c d g^{4} + a^{2} b^{2} d^{2} g^{4}} - \frac{1}{{\left (b^{2} c g^{2} - a b d g^{2}\right )}{\left (b g x + a g\right )} b g}\right )} - \frac{\log \left (\frac{{\left (b x + a\right )}^{2} e}{{\left (d x + c\right )}^{2}}\right )}{{\left (b g x + a g\right )} b g}\right )} B - \frac{A}{{\left (b g x + a g\right )} b g} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]